package LeetCode;

import Constructs.TreeNode;

//
// Created by ✎﹏ℳ๓独赏☆独醉 on 2024/6/2.
//
//https://leetcode.cn/problems/maximum-depth-of-binary-tree/
public class 二叉树的最大深度 {
    public static void main(String[] args) {

    }
    public static int maxDepth(TreeNode root) {
        if(root == null){
            return 0;
        }else {
            return 1 + Math.max(maxDepth(root.left),maxDepth(root.right));
        }
    }
}
